3.274 \(\int (g+h x)^{-3-2 p} (a+b x+c x^2)^p (d+e x+f x^2) \, dx\)

Optimal. Leaf size=590 \[ -\frac{f (g+h x)^{-2 p} \left (a+b x+c x^2\right )^p \left (1-\frac{2 c (g+h x)}{2 c g-h \left (b-\sqrt{b^2-4 a c}\right )}\right )^{-p} \left (1-\frac{2 c (g+h x)}{2 c g-h \left (\sqrt{b^2-4 a c}+b\right )}\right )^{-p} F_1\left (-2 p;-p,-p;1-2 p;\frac{2 c (g+h x)}{2 c g-\left (b-\sqrt{b^2-4 a c}\right ) h},\frac{2 c (g+h x)}{2 c g-\left (b+\sqrt{b^2-4 a c}\right ) h}\right )}{2 h^3 p}-\frac{\left (-\sqrt{b^2-4 a c}+b+2 c x\right ) (g+h x)^{-2 p-1} \left (a+b x+c x^2\right )^p \left (\frac{\left (\sqrt{b^2-4 a c}+b+2 c x\right ) \left (2 c g-h \left (b-\sqrt{b^2-4 a c}\right )\right )}{\left (-\sqrt{b^2-4 a c}+b+2 c x\right ) \left (2 c g-h \left (\sqrt{b^2-4 a c}+b\right )\right )}\right )^{-p} \left (h \left (2 a h (2 f g-e h)-b \left (-d h^2-e g h+3 f g^2\right )\right )+2 c \left (f g^3-d g h^2\right )\right ) \, _2F_1\left (-2 p-1,-p;-2 p;-\frac{4 c \sqrt{b^2-4 a c} (g+h x)}{\left (2 c g-\left (b+\sqrt{b^2-4 a c}\right ) h\right ) \left (b+2 c x-\sqrt{b^2-4 a c}\right )}\right )}{2 h^2 (2 p+1) \left (2 c g-h \left (b-\sqrt{b^2-4 a c}\right )\right ) \left (a h^2-b g h+c g^2\right )}-\frac{(g+h x)^{-2 (p+1)} \left (a+b x+c x^2\right )^{p+1} \left (f g^2-h (e g-d h)\right )}{2 h (p+1) \left (a h^2-b g h+c g^2\right )} \]

[Out]

-((f*g^2 - h*(e*g - d*h))*(a + b*x + c*x^2)^(1 + p))/(2*h*(c*g^2 - b*g*h + a*h^2)*(1 + p)*(g + h*x)^(2*(1 + p)
)) - (f*(a + b*x + c*x^2)^p*AppellF1[-2*p, -p, -p, 1 - 2*p, (2*c*(g + h*x))/(2*c*g - (b - Sqrt[b^2 - 4*a*c])*h
), (2*c*(g + h*x))/(2*c*g - (b + Sqrt[b^2 - 4*a*c])*h)])/(2*h^3*p*(g + h*x)^(2*p)*(1 - (2*c*(g + h*x))/(2*c*g
- (b - Sqrt[b^2 - 4*a*c])*h))^p*(1 - (2*c*(g + h*x))/(2*c*g - (b + Sqrt[b^2 - 4*a*c])*h))^p) - ((2*c*(f*g^3 -
d*g*h^2) + h*(2*a*h*(2*f*g - e*h) - b*(3*f*g^2 - e*g*h - d*h^2)))*(b - Sqrt[b^2 - 4*a*c] + 2*c*x)*(g + h*x)^(-
1 - 2*p)*(a + b*x + c*x^2)^p*Hypergeometric2F1[-1 - 2*p, -p, -2*p, (-4*c*Sqrt[b^2 - 4*a*c]*(g + h*x))/((2*c*g
- (b + Sqrt[b^2 - 4*a*c])*h)*(b - Sqrt[b^2 - 4*a*c] + 2*c*x))])/(2*h^2*(2*c*g - (b - Sqrt[b^2 - 4*a*c])*h)*(c*
g^2 - b*g*h + a*h^2)*(1 + 2*p)*(((2*c*g - (b - Sqrt[b^2 - 4*a*c])*h)*(b + Sqrt[b^2 - 4*a*c] + 2*c*x))/((2*c*g
- (b + Sqrt[b^2 - 4*a*c])*h)*(b - Sqrt[b^2 - 4*a*c] + 2*c*x)))^p)

________________________________________________________________________________________

Rubi [A]  time = 0.755247, antiderivative size = 588, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 34, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.147, Rules used = {1655, 759, 133, 806, 726} \[ -\frac{f (g+h x)^{-2 p} \left (a+b x+c x^2\right )^p \left (1-\frac{2 c (g+h x)}{2 c g-h \left (b-\sqrt{b^2-4 a c}\right )}\right )^{-p} \left (1-\frac{2 c (g+h x)}{2 c g-h \left (\sqrt{b^2-4 a c}+b\right )}\right )^{-p} F_1\left (-2 p;-p,-p;1-2 p;\frac{2 c (g+h x)}{2 c g-\left (b-\sqrt{b^2-4 a c}\right ) h},\frac{2 c (g+h x)}{2 c g-\left (b+\sqrt{b^2-4 a c}\right ) h}\right )}{2 h^3 p}-\frac{\left (-\sqrt{b^2-4 a c}+b+2 c x\right ) (g+h x)^{-2 p-1} \left (a+b x+c x^2\right )^p \left (\frac{\left (\sqrt{b^2-4 a c}+b+2 c x\right ) \left (2 c g-h \left (b-\sqrt{b^2-4 a c}\right )\right )}{\left (-\sqrt{b^2-4 a c}+b+2 c x\right ) \left (2 c g-h \left (\sqrt{b^2-4 a c}+b\right )\right )}\right )^{-p} \left (2 c \left (f g^3-d g h^2\right )-h \left (-2 a h (2 f g-e h)-b h (d h+e g)+3 b f g^2\right )\right ) \, _2F_1\left (-2 p-1,-p;-2 p;-\frac{4 c \sqrt{b^2-4 a c} (g+h x)}{\left (2 c g-\left (b+\sqrt{b^2-4 a c}\right ) h\right ) \left (b+2 c x-\sqrt{b^2-4 a c}\right )}\right )}{2 h^2 (2 p+1) \left (2 c g-h \left (b-\sqrt{b^2-4 a c}\right )\right ) \left (a h^2-b g h+c g^2\right )}-\frac{(g+h x)^{-2 (p+1)} \left (a+b x+c x^2\right )^{p+1} \left (f g^2-h (e g-d h)\right )}{2 h (p+1) \left (a h^2-b g h+c g^2\right )} \]

Antiderivative was successfully verified.

[In]

Int[(g + h*x)^(-3 - 2*p)*(a + b*x + c*x^2)^p*(d + e*x + f*x^2),x]

[Out]

-((f*g^2 - h*(e*g - d*h))*(a + b*x + c*x^2)^(1 + p))/(2*h*(c*g^2 - b*g*h + a*h^2)*(1 + p)*(g + h*x)^(2*(1 + p)
)) - (f*(a + b*x + c*x^2)^p*AppellF1[-2*p, -p, -p, 1 - 2*p, (2*c*(g + h*x))/(2*c*g - (b - Sqrt[b^2 - 4*a*c])*h
), (2*c*(g + h*x))/(2*c*g - (b + Sqrt[b^2 - 4*a*c])*h)])/(2*h^3*p*(g + h*x)^(2*p)*(1 - (2*c*(g + h*x))/(2*c*g
- (b - Sqrt[b^2 - 4*a*c])*h))^p*(1 - (2*c*(g + h*x))/(2*c*g - (b + Sqrt[b^2 - 4*a*c])*h))^p) - ((2*c*(f*g^3 -
d*g*h^2) - h*(3*b*f*g^2 - b*h*(e*g + d*h) - 2*a*h*(2*f*g - e*h)))*(b - Sqrt[b^2 - 4*a*c] + 2*c*x)*(g + h*x)^(-
1 - 2*p)*(a + b*x + c*x^2)^p*Hypergeometric2F1[-1 - 2*p, -p, -2*p, (-4*c*Sqrt[b^2 - 4*a*c]*(g + h*x))/((2*c*g
- (b + Sqrt[b^2 - 4*a*c])*h)*(b - Sqrt[b^2 - 4*a*c] + 2*c*x))])/(2*h^2*(2*c*g - (b - Sqrt[b^2 - 4*a*c])*h)*(c*
g^2 - b*g*h + a*h^2)*(1 + 2*p)*(((2*c*g - (b - Sqrt[b^2 - 4*a*c])*h)*(b + Sqrt[b^2 - 4*a*c] + 2*c*x))/((2*c*g
- (b + Sqrt[b^2 - 4*a*c])*h)*(b - Sqrt[b^2 - 4*a*c] + 2*c*x)))^p)

Rule 1655

Int[(Pq_)*((d_.) + (e_.)*(x_))^(m_.)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> With[{q = Expon[P
q, x]}, Dist[Coeff[Pq, x, q]/e^q, Int[(d + e*x)^(m + q)*(a + b*x + c*x^2)^p, x], x] + Dist[1/e^q, Int[(d + e*x
)^m*(a + b*x + c*x^2)^p*ExpandToSum[e^q*Pq - Coeff[Pq, x, q]*(d + e*x)^q, x], x], x]] /; FreeQ[{a, b, c, d, e,
 m, p}, x] && PolyQ[Pq, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] &&  !(IGtQ[m, 0] && Rationa
lQ[a, b, c, d, e] && (IntegerQ[p] || ILtQ[p + 1/2, 0]))

Rule 759

Int[((d_.) + (e_.)*(x_))^(m_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> With[{q = Rt[b^2 - 4*a*c,
 2]}, Dist[(a + b*x + c*x^2)^p/(e*(1 - (d + e*x)/(d - (e*(b - q))/(2*c)))^p*(1 - (d + e*x)/(d - (e*(b + q))/(2
*c)))^p), Subst[Int[x^m*Simp[1 - x/(d - (e*(b - q))/(2*c)), x]^p*Simp[1 - x/(d - (e*(b + q))/(2*c)), x]^p, x],
 x, d + e*x], x]] /; FreeQ[{a, b, c, d, e, m, p}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] &
& NeQ[2*c*d - b*e, 0] &&  !IntegerQ[p]

Rule 133

Int[((b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_)*((e_) + (f_.)*(x_))^(p_), x_Symbol] :> Simp[(c^n*e^p*(b*x)^(m +
 1)*AppellF1[m + 1, -n, -p, m + 2, -((d*x)/c), -((f*x)/e)])/(b*(m + 1)), x] /; FreeQ[{b, c, d, e, f, m, n, p},
 x] &&  !IntegerQ[m] &&  !IntegerQ[n] && GtQ[c, 0] && (IntegerQ[p] || GtQ[e, 0])

Rule 806

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> -Si
mp[((e*f - d*g)*(d + e*x)^(m + 1)*(a + b*x + c*x^2)^(p + 1))/(2*(p + 1)*(c*d^2 - b*d*e + a*e^2)), x] - Dist[(b
*(e*f + d*g) - 2*(c*d*f + a*e*g))/(2*(c*d^2 - b*d*e + a*e^2)), Int[(d + e*x)^(m + 1)*(a + b*x + c*x^2)^p, x],
x] /; FreeQ[{a, b, c, d, e, f, g, m, p}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && EqQ[Sim
plify[m + 2*p + 3], 0]

Rule 726

Int[((d_.) + (e_.)*(x_))^(m_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> -Simp[((b - Rt[b^2 - 4*a*
c, 2] + 2*c*x)*(d + e*x)^(m + 1)*(a + b*x + c*x^2)^p*Hypergeometric2F1[m + 1, -p, m + 2, (-4*c*Rt[b^2 - 4*a*c,
 2]*(d + e*x))/((2*c*d - b*e - e*Rt[b^2 - 4*a*c, 2])*(b - Rt[b^2 - 4*a*c, 2] + 2*c*x))])/((m + 1)*(2*c*d - b*e
 + e*Rt[b^2 - 4*a*c, 2])*(((2*c*d - b*e + e*Rt[b^2 - 4*a*c, 2])*(b + Rt[b^2 - 4*a*c, 2] + 2*c*x))/((2*c*d - b*
e - e*Rt[b^2 - 4*a*c, 2])*(b - Rt[b^2 - 4*a*c, 2] + 2*c*x)))^p), x] /; FreeQ[{a, b, c, d, e, m, p}, x] && NeQ[
b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && NeQ[2*c*d - b*e, 0] &&  !IntegerQ[p] && EqQ[m + 2*p + 2, 0
]

Rubi steps

\begin{align*} \int (g+h x)^{-3-2 p} \left (a+b x+c x^2\right )^p \left (d+e x+f x^2\right ) \, dx &=\frac{\int (g+h x)^{-3-2 p} \left (-f g^2+d h^2-h (2 f g-e h) x\right ) \left (a+b x+c x^2\right )^p \, dx}{h^2}+\frac{f \int (g+h x)^{-1-2 p} \left (a+b x+c x^2\right )^p \, dx}{h^2}\\ &=-\frac{\left (f g^2-h (e g-d h)\right ) (g+h x)^{-2 (1+p)} \left (a+b x+c x^2\right )^{1+p}}{2 h \left (c g^2-b g h+a h^2\right ) (1+p)}-\frac{\left (2 c \left (f g^3-d g h^2\right )-h \left (3 b f g^2-b h (e g+d h)-2 a h (2 f g-e h)\right )\right ) \int (g+h x)^{-2-2 p} \left (a+b x+c x^2\right )^p \, dx}{2 h^2 \left (c g^2-b g h+a h^2\right )}+\frac{\left (f \left (a+b x+c x^2\right )^p \left (1-\frac{g+h x}{g-\frac{\left (b-\sqrt{b^2-4 a c}\right ) h}{2 c}}\right )^{-p} \left (1-\frac{g+h x}{g-\frac{\left (b+\sqrt{b^2-4 a c}\right ) h}{2 c}}\right )^{-p}\right ) \operatorname{Subst}\left (\int x^{-1-2 p} \left (1-\frac{2 c x}{2 c g-\left (b-\sqrt{b^2-4 a c}\right ) h}\right )^p \left (1-\frac{2 c x}{2 c g-\left (b+\sqrt{b^2-4 a c}\right ) h}\right )^p \, dx,x,g+h x\right )}{h^3}\\ &=-\frac{\left (f g^2-h (e g-d h)\right ) (g+h x)^{-2 (1+p)} \left (a+b x+c x^2\right )^{1+p}}{2 h \left (c g^2-b g h+a h^2\right ) (1+p)}-\frac{f (g+h x)^{-2 p} \left (a+b x+c x^2\right )^p \left (1-\frac{2 c (g+h x)}{2 c g-\left (b-\sqrt{b^2-4 a c}\right ) h}\right )^{-p} \left (1-\frac{2 c (g+h x)}{2 c g-\left (b+\sqrt{b^2-4 a c}\right ) h}\right )^{-p} F_1\left (-2 p;-p,-p;1-2 p;\frac{2 c (g+h x)}{2 c g-\left (b-\sqrt{b^2-4 a c}\right ) h},\frac{2 c (g+h x)}{2 c g-\left (b+\sqrt{b^2-4 a c}\right ) h}\right )}{2 h^3 p}-\frac{\left (2 c \left (f g^3-d g h^2\right )-h \left (3 b f g^2-b h (e g+d h)-2 a h (2 f g-e h)\right )\right ) \left (b-\sqrt{b^2-4 a c}+2 c x\right ) \left (\frac{\left (2 c g-\left (b-\sqrt{b^2-4 a c}\right ) h\right ) \left (b+\sqrt{b^2-4 a c}+2 c x\right )}{\left (2 c g-\left (b+\sqrt{b^2-4 a c}\right ) h\right ) \left (b-\sqrt{b^2-4 a c}+2 c x\right )}\right )^{-p} (g+h x)^{-1-2 p} \left (a+b x+c x^2\right )^p \, _2F_1\left (-1-2 p,-p;-2 p;-\frac{4 c \sqrt{b^2-4 a c} (g+h x)}{\left (2 c g-\left (b+\sqrt{b^2-4 a c}\right ) h\right ) \left (b-\sqrt{b^2-4 a c}+2 c x\right )}\right )}{2 h^2 \left (2 c g-\left (b-\sqrt{b^2-4 a c}\right ) h\right ) \left (c g^2-b g h+a h^2\right ) (1+2 p)}\\ \end{align*}

Mathematica [F]  time = 3.63639, size = 0, normalized size = 0. \[ \int (g+h x)^{-3-2 p} \left (a+b x+c x^2\right )^p \left (d+e x+f x^2\right ) \, dx \]

Verification is Not applicable to the result.

[In]

Integrate[(g + h*x)^(-3 - 2*p)*(a + b*x + c*x^2)^p*(d + e*x + f*x^2),x]

[Out]

Integrate[(g + h*x)^(-3 - 2*p)*(a + b*x + c*x^2)^p*(d + e*x + f*x^2), x]

________________________________________________________________________________________

Maple [F]  time = 1.356, size = 0, normalized size = 0. \begin{align*} \int \left ( hx+g \right ) ^{-3-2\,p} \left ( c{x}^{2}+bx+a \right ) ^{p} \left ( f{x}^{2}+ex+d \right ) \, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((h*x+g)^(-3-2*p)*(c*x^2+b*x+a)^p*(f*x^2+e*x+d),x)

[Out]

int((h*x+g)^(-3-2*p)*(c*x^2+b*x+a)^p*(f*x^2+e*x+d),x)

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (f x^{2} + e x + d\right )}{\left (c x^{2} + b x + a\right )}^{p}{\left (h x + g\right )}^{-2 \, p - 3}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((h*x+g)^(-3-2*p)*(c*x^2+b*x+a)^p*(f*x^2+e*x+d),x, algorithm="maxima")

[Out]

integrate((f*x^2 + e*x + d)*(c*x^2 + b*x + a)^p*(h*x + g)^(-2*p - 3), x)

________________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left ({\left (f x^{2} + e x + d\right )}{\left (c x^{2} + b x + a\right )}^{p}{\left (h x + g\right )}^{-2 \, p - 3}, x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((h*x+g)^(-3-2*p)*(c*x^2+b*x+a)^p*(f*x^2+e*x+d),x, algorithm="fricas")

[Out]

integral((f*x^2 + e*x + d)*(c*x^2 + b*x + a)^p*(h*x + g)^(-2*p - 3), x)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((h*x+g)**(-3-2*p)*(c*x**2+b*x+a)**p*(f*x**2+e*x+d),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (f x^{2} + e x + d\right )}{\left (c x^{2} + b x + a\right )}^{p}{\left (h x + g\right )}^{-2 \, p - 3}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((h*x+g)^(-3-2*p)*(c*x^2+b*x+a)^p*(f*x^2+e*x+d),x, algorithm="giac")

[Out]

integrate((f*x^2 + e*x + d)*(c*x^2 + b*x + a)^p*(h*x + g)^(-2*p - 3), x)